import matplotlib.pyplot as plt
from matplotlib.font_manager import FontProperties

# 确保能显示中文字体，这里假设使用“SimHei”字体，需根据本地字体情况调整
font = FontProperties(fname=r"C:\Windows\Fonts\simhei.ttf", size=12)
title_font = FontProperties(fname=r"C:\Windows\Fonts\simhei.ttf", size=18)
author_font = FontProperties(fname=r"C:\Windows\Fonts\simhei.ttf", size=10)

# 创建画布
plt.figure(figsize=(8, 6))

# 绘制标题
plt.text(0.5, 0.9, "白露即景", ha='center', fontproperties=title_font)

# 绘制作者信息
plt.text(0.5, 0.85, "作者：张军（湖北天门）", ha='center', fontproperties=author_font)

# 绘制诗句
poem_lines = [
    "白露垂珠晓色开，田畴次第报秋来。",
    "风摇稻谷金波涌，日映棉花云朵堆。",
    "雁字欲书天作纸，蛩声勤织月为媒。",
    "心随稔岁悠然至，闲看青黄缓缓裁。"
]

y_pos = 0.7
for line in poem_lines:
    plt.text(0.5, y_pos, line, ha='center', fontproperties=font)
    y_pos -= 0.1

# 隐藏坐标轴
plt.axis('off')

# 显示图像
plt.show()